// 报名限制翻译
function enrollLimitTran(enrollLimit){
    var res = {};
    res['register'] = enrollLimit & 1 == 1;
    res['autoCheck'] = enrollLimit >> 1 & 1 == 1;
    res['readOthers'] = enrollLimit >> 2 & 1 == 1;
    return res;
}
// 结束方式翻译
function endMethodTran(endMethod){
    var res = {};
    res['num'] = endMethod & 1 == 1;
    res['time'] = endMethod >> 1 & 1 == 1;
    return res;
}
// 报名元数据状态翻译
function enrollMetaStatusTran(status){
    if(status == 0)
        return "进行中";
    else
        return "已终止";
}
function enrollDataStatusTran(status){
    if(status == 0)
        return "审核中";
    if(status == 1)
        return "已通过";
    if(status == 2)
        return "被拒绝";
    if(status == 3)
        return "预报名";
}
function joinMetTran(joinMet){
    return joinMet == 1 ? '管理员添加':'自行注册';
}
function identifyTran(identify){
    if(identify == 0)
        return "用户";
    if(identify == 1)
        return "管理员";
    if(identify == 2)
        return "限制用户";
}
var tranUtil = {
    enrollLimitTran : enrollLimitTran,
    endMethodTran : endMethodTran,
    enrollMetaStatusTran : enrollMetaStatusTran,
    enrollDataStatusTran : enrollDataStatusTran,
    identifyTran : identifyTran,
    joinMetTran : joinMetTran
}

module.exports = {
	tranUtil: tranUtil
}